public class MachineFactory {
    public AgriculturalMachine createMachine(String type) {
        return switch (type.toLowerCase()) {
            case "seeder" -> new Seeder();
            case "sprayer" -> new Sprayer();
            case "harvester" -> new Harvester();
            default -> throw new IllegalArgumentException("未知农机类型: " + type);
        };
    }
}